cody - HTMLify profile

cody
4270 Files
634360 Views
Latest files of /cody/swapnilsparsh/30DaysOfJavaScript/149 - Snake Game Voice
var canvas = document.getElementById("area");
canvas.style.height = "80vh";
canvas.style.width = "80%";
var clx = canvas.getContext("2d")
var xr = Math.floor(Math.random()*(canvas.width-40)+20);
canvas.style.height = "80vh";
canvas.style.width = "80%";
var clx = canvas.getContext("2d")
var xr = Math.floor(Math.random()*(canvas.width-40)+20);
const URL = "https://teachablemachine.withgoogle.com/models/JHem2FpyN/";
async function createModel() {
const checkpointURL = URL + "model.json";
const metadataURL = URL + "metadata.json";
const recognizer = speechCommands.create(
*{
margin: 2px;
padding: 2px;
box-sizing: border-box;
}
body{
background-color: rgb(4, 230, 4);
margin: 2px;
padding: 2px;
box-sizing: border-box;
}
body{
background-color: rgb(4, 230, 4);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
# Snake game using voice control
This is a snake game in which a snake moves inside a box in search of food. Snake movement is controlled using voice commands - 'down', 'left', 'up', 'right'.
Whenever the snake consumes it's food, it's size increases by one unit.
If the snake touches the border of the box or it's tail, the game stops.
## **Usage**
* Download all the files and open html file in the browser of your choice.
* Allow microphone and click on 'play'.
This is a snake game in which a snake moves inside a box in search of food. Snake movement is controlled using voice commands - 'down', 'left', 'up', 'right'.
Whenever the snake consumes it's food, it's size increases by one unit.
If the snake touches the border of the box or it's tail, the game stops.
## **Usage**
* Download all the files and open html file in the browser of your choice.
* Allow microphone and click on 'play'.